package problema007;

public class Prime10001 {
	
	public static void main(String[] args){
		System.out.println(prime10001());
		//System.out.println(esPrimo(9));
	}
	
	public static double prime10001(){
		int cant = 0;
		double act = 2;
		while(true){
			if(esPrimo(act)){
				cant++;
				if(cant == 10001) break;
			}
			act++;
		}
		return act;
	}
	
	
	public static boolean esPrimo(double num){
		double hasta = Math.sqrt(num);
		int hastaI = (int) hasta;
		for(int i = 2; i <= hastaI; i++){
			if(num % i == 0) return false;
		}
		return true;
	}

}
